<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        /* 
            Math对象的常用方法
        */

        console.log(Math.PI);

        //获取绝对值
        console.log(Math.abs(-15));
        console.log(Math.abs(15));
        console.log(Math.abs('abc'));//NaN

        //向下取整
        console.log(Math.floor(1.1))
        console.log(Math.floor(1.9))

        //向上取整
        console.log(Math.ceil(1.1))
        console.log(Math.ceil(1.9))
console.log('-----------')
        //四舍五入
        console.log(Math.round(1.1))
        console.log(Math.round(1.5))
        console.log(Math.round(1.6))
        console.log(Math.round(-1.1))
        console.log(Math.round(-1.5))
        console.log(Math.round(-1.6))
    </script>
</head>
<body>
    
</body>
</html>